﻿using System.Linq;
using Columbus;
using $safeprojectname$.Home.ViewModels;

namespace $safeprojectname$.Home
{
    public class HomeController : Controller
    {
        private readonly ItemRepository repository;

        public HomeController(ItemRepository repository)
        {
            this.repository = repository;
        }

        public ActionResult HomePage()
        {
            var data = repository.GetItems().ToArray();

            var viewModel = new HomePageViewModel { Items = data };

            return Page(viewModel);
        }
    }
}
